package com.ymatou.iapi.platformdiscounts.service;

import com.ymatou.iapi.platformdiscounts.parameter.DiscountInfo.ProductDiscountsInfo;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*查询优惠信息Call
*FreeMaker Template自动生成代码
*/
public class QueryCall extends YmatouBaseCall{
	private static String opurl ="discount/query";
	
	public QueryCall() {
		super(EnvSetup.getSystemUrl("platformdiscounts_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
	//	client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	
	public String getErrorMsg()
    {
        return getString("errorMsg");
    }
 

	 public String getErrorCode()
	 {
	      return getString("errorCode");
	 }
 
	 public String getProductDiscounts()
	 {
	      return getString("productDiscounts");
	 }
	 
	public ProductDiscountsInfo getCallData()
	{
		ProductDiscountsInfo data = null;
		try {
			data = (ProductDiscountsInfo) FormatUtil.GSONToObject(this.getReturnData(), ProductDiscountsInfo.class);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
}